<!DOCTYPE html>
<html lang="zh-CN" xmlns="http://www.w3.org/1999/xhtml"
      xmlns:th="http://www.thymeleaf.org">
<head th:include="/common/inc::header"/>
<body>
<form class="layui-form" style="margin-top: 15px">
    <div class="layui-form-item">
        <label class="layui-form-label" style="width: 60px">手机号码:</label>
        <div class="layui-input-inline">
            <input type="text" name="account" id="account" autocomplete="off"
                   class="layui-input">
        </div>
        <label class="layui-form-label" style="width: 60px">姓名:</label>
        <div class="layui-input-inline">
            <input type="text" name="examineeName" id="examineeName" autocomplete="off"
                   class="layui-input">
        </div>
        <label class="layui-form-label" style="width: 60px">所属机构:</label>
        <div class="layui-input-inline">
            <input type="text" name="examineeInstitution" id="examineeInstitution" autocomplete="off"
                   class="layui-input">
        </div>
        <label class="layui-form-label" style="width: 60px">身份证:</label>
        <div class="layui-input-inline">
            <input type="text" name="idCard" id="idCard" autocomplete="off"
                   class="layui-input">
        </div>
        <label class="layui-form-label" style="width: 60px">性别:</label>
        <div class="layui-input-inline">
            <select name="examineeHallId" id="afterTime" lay-filter="afterTime">
                <option value="">全部</option>
                <option value="男">男</option>
                <option value="女">女</option>
            </select>
        </div>
        <button class="layui-btn" id="searchBtn" lay-submit lay-filter="searchBtn">查询</button>
    </div>
</form>
<table class="layui-table" id="grid" lay-filter="grid">
</table>
<script th:replace="/common/inc::incJs"></script>
<style type="text/css">
    .layui-table-header {
        width: 1167px;
    }
</style>
<script>
    var allStr;

    $(function () {
        var tableIns = createTable({
            url: 'list',
            cols: [[
                {field: 'examineeName', title: '考生姓名', width: 200}, {
                    field: 'idCard',
                    title: '身份证号',
                    width: 250
                }, {field: 'sex', title: '性别', width: 150}
                , {field: 'account', title: '手机号码', width: 180}, {
                    field: 'examineeInstitution',
                    title: '所属机构',
                    width: 180
                }, {
                    fixed: 'right',
                    title: '操作',
                    width: 200,
                    align: 'center',
                    toolbar: '#opbar'
                }
            ]]
        });

        layui.table.on('tool(grid)', function (obj) { //注：tool是工具条事件名，test是table原始容器的属性 lay-filter="对应的值"
            var data = obj.data; //获得当前行数据
            var layEvent = obj.event; //获得 lay-event 对应的值
            var tr = obj.tr; //获得当前行 tr 的DOM对象
            if (layEvent === 'edit') { //编辑
                openDialog({
                    url: "/backend/security/examineeInfo/detail?id=" + data.id,
                    area: ["95%", "95%"]
                });
            }
        });

        layui.form.on('submit(searchBtn)', function (data) {
            tableIns.reload({
                where: data.field
            });
            return false;
        });
    })
</script>
<script type="text/html" id="opbar">
    <a class="layui-btn layui-btn-xs" lay-event="edit">查看详情</a>
</script>
</body>
</html>
